﻿<Page
    x:Class="Netflix.ClientApp.View.TitleDetailsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     DataContext="{Binding TitleDetailsViewModel, Source={StaticResource Locator}}"
    mc:Ignorable="d">

    <Grid Background="#B9090B">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid  Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" x:Name="LeftMargin" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button Name="BtnBack"
                    Command="{Binding GoBackCommand}" 
                    IsEnabled="{Binding NavigationService.CanGoBack, ElementName=PageRoot}"
                    Style="{StaticResource BackButtonStyle}" />
            <TextBlock Name="Title" Foreground="{StaticResource ForegroundBrush}"
                       Grid.Column="1" IsHitTestVisible="false" TextWrapping="Wrap"
                       Style="{StaticResource PageHeaderTextStyle}" Text="{Binding Item.Name}"/>

        </Grid>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="2" >
            <Image  CacheMode="BitmapCache" Source="{Binding Item.Image}"  Stretch="Uniform"  Margin="10,10,5,10"/>
            <StackPanel  Margin="10,10,5,10">
                <StackPanel Orientation="Horizontal" Margin="0,10,10,0">
                    <TextBlock  Margin="0,0,5,5" Text="Rating:"  FontSize="20" />
                    <TextBlock  Margin="0,0,0,5" Text="{Binding Item.Rating}"  FontSize="20" />
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="0,0,10,0" >
                    <TextBlock  Margin="0,0,0,5" Text="Available:"  FontSize="20"/>
                    <TextBlock Text="{Binding Item.AvailableFrom,  
                                                   Converter={StaticResource StringFormatConverter}, ConverterParameter=\{0:d MMMM yyyy\}}" 
                                                   TextWrapping="Wrap"  FontSize="20" />
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </Grid>
</Page>